import request from '@/utils/request'

export function dictPagination(query) {
  return request({
    url: '/api/sys/dict/pagination',
    method: 'post',
    data: query
  })
}

export function userPagination(query) {
  return request({
    url: '/api/sys/user/pagination',
    method: 'post',
    data: query
  })
}

export function userRegister(query) {
  return request({
    url: '/api/sys/register',
    method: 'post',
    data: query
  })
}

export function userList(query) {
  return request({
    url: '/api/sys/user/list',
    method: 'get',
    params: query
  })
}

export function userEdit(data){
  return request({
    url:'/api/sys/user/edit',
    method:'put',
    data
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createDict(data) {
  return request({
    url: '/api/sys/dict/add',
    method: 'post',
    data
  })
}

export function deleteDict(dict_id) {
  return request({
    url: '/api/sys/dict/physical/delete',
    method: 'delete',
    params: dict_id
  })
}

export function updateDict(data) {
  return request({
    url: '/api/sys/dict/edit',
    method: 'put',
    data
  })
}

export function dictItemPagination(query) {
  return request({
    url: '/api/sys/dictitem/pagination',
    method: 'post',
    data: query
  })
}

export function listDict(orm_id) {
  return request({
    url: '/api/sys/dict/list',
    method: 'get',
    params: orm_id
  })
}
